﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.FactoryUI {
    import flash.display.*;
    import org.aswing.*;
    import Display.MarketUI.*;
    import org.aswing.event.*;
    import org.aswing.ext.*;
    import Display.aswingui.*;

    public class SuppliesScrollingList extends MarketScrollingList {

        public function SuppliesScrollingList(_arg1:Array, _arg2:Class, _arg3:int, _arg4:int=0, _arg5:int=0){
            super(_arg1, _arg2, _arg3, _arg4, _arg5);
        }
        override protected function makeData():void{
            var _local1:Array = new Array();
            var _local2:Array = new Array();
            var _local3:int;
            while (_local3 < m_data.length) {
                if ((_local3 % 2) == 0){
                    _local1.push(m_data[_local3]);
                } else {
                    _local2.push(m_data[_local3]);
                };
                _local3++;
            };
            var _local4:Array = _local1.concat(_local2);
            var _local5:VectorListModel = new VectorListModel();
            var _local6:int;
            while (_local6 < _local4.length) {
                _local5.append(_local4[_local6]);
                _local6++;
            };
            m_dataList = new GridList(_local5, m_cellFactory, m_columns, m_rows);
            m_scrollPane = new JScrollPane(m_dataList, JScrollPane.SCROLLBAR_NEVER, JScrollPane.SCROLLBAR_NEVER);
        }
        override protected function prepare():void{
            this.append(leftBtn);
            this.append(m_scrollPane);
            this.append(rightBtn);
            ASwingHelper.prepare(this);
        }
        override protected function makeButtons():void{
            var _local1:DisplayObject = (new (SuppliesDialog.assetDict["left_green_arrow"])() as DisplayObject);
            var _local2:DisplayObject = (new (SuppliesDialog.assetDict["right_green_arrow"])() as DisplayObject);
            leftBtn = new JButton();
            leftBtn.wrapSimpleButton(new SimpleButton(_local1, _local1, _local1, _local1));
            rightBtn = new JButton();
            rightBtn.wrapSimpleButton(new SimpleButton(_local2, _local2, _local2, _local2));
            rightBtn.addActionListener(this.moveRight, 0, true);
            leftBtn.addActionListener(this.moveLeft, 0, true);
        }
        override protected function initSize():void{
            this.m_dataList.setHGap(4);
            this.m_dataList.setVGap(10);
            m_scrollPane.setPreferredWidth(494);
        }
        override protected function moveLeft(_arg1:AWEvent):void{
            m_dataList.scrollHorizontal(-(249));
        }
        override protected function moveRight(_arg1:AWEvent):void{
            m_dataList.scrollHorizontal(249);
        }

    }
}//package Display.FactoryUI 
